//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package come.tool.JDialog;

import org.come.Frame.PartnerJframe;
import org.come.Frame.ZhuFrame;
import org.come.Jpanel.PartnerMainJpanel;
import org.come.Jpanel.TestChildAttributeJpanel;
import org.come.Jpanel.TestChildCardJpanel;
import org.come.bean.LoginResult;
import org.come.entity.Baby;
import org.come.entity.Pal;
import org.come.model.Lingbao;
import org.come.socket.Agreement;
import org.come.socket.SendMessageUntil;
import org.come.until.UserData;

import com.tool.role.RoleData;
import com.tool.role.RoleLingFa;
import com.tool.role.RoleProperty;

// 伙伴孩子
public class PalToBabyJDialog implements TiShiChuLi {
	public PalToBabyJDialog() {
	}

	public void tipBox(boolean tishi, Object object) {
		Baby baby = (Baby) object;
		if (tishi) {
			LoginResult loginResult = RoleData.getRoleData().getLoginResult();
			PartnerMainJpanel mainJpanel = PartnerJframe.getPartnerJframe().getPartnerMainJpanel();
			if (mainJpanel.getPalDataChooseId() < 0) {
				ZhuFrame.getZhuJpanel().addPrompt2("请选择一个伙伴");
				return;
			}
			Pal pidGetPal = mainJpanel.pidGetPal(mainJpanel.getPalDataChooseId());
			if (pidGetPal == null) {
				return;
			}
			loginResult.setBabyId(null);
    		RoleProperty.ResetBaby(null);
			String sendmes = Agreement.getAgreement()
					.userpalAgreement(pidGetPal.getId() + "|baby|" + baby.getBabyid());
			SendMessageUntil.toServer(sendmes);
			TestChildAttributeJpanel.btnStandbyapl.setText("领回");
		}
	}
}
